package com.cms.util;

import java.util.Arrays;


public class LockInfo {

    String lockId;
    static KeyLock<String> lock = new KeyLock<String>();

    public LockInfo(String lockId) {
        String[] keys = new String[] { lockId };
        Arrays.sort(keys);
        this.lockId = lockId;
        lock.lock(lockId);
    }

    public String getLockId() {

        return lockId;
    }

    public void setLockId(String lockId) {

        this.lockId = lockId;
    }

    public void unlock() {
        lock.unlock(lockId);
    }

}
